config: hide sensitive input during baudbot config#32
Merged
Conversation
prompt_secret now uses read -rs (silent mode) for API keys, tokens, and secrets so they aren't echoed to the terminal. Non-sensitive fields like email addresses, user IDs, and org slugs remain visible. Falls back to plain read when stdin is not a terminal (piped input in CI), so automated tests are unaffected.
Greptile SummaryAdds password-style hidden input ( Key changes:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 5953504 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
baudbot config(orinstall.sh) echoes API keys and tokens in plaintext on the terminal. Anyone looking at the screen can see them.Fix
prompt_secretnow accepts asensitiveparameter (6th arg, defaults totrue). When true and stdin is a terminal, usesread -rsto suppress echo.Hidden (sensitive=true, default): API keys, tokens, secrets
ANTHROPIC_API_KEY,OPENAI_API_KEY,GEMINI_API_KEY,OPENCODE_ZEN_API_KEYGITHUB_TOKEN,SLACK_BOT_TOKEN,SLACK_APP_TOKENAGENTMAIL_API_KEY,BAUDBOT_SECRET,SENTRY_AUTH_TOKEN,KERNEL_API_KEYVisible (sensitive=false): non-secret identifiers
SLACK_ALLOWED_USERS,BAUDBOT_EMAIL,BAUDBOT_ALLOWED_EMAILSSENTRY_ORG,SENTRY_CHANNEL_IDMatches the
@sensitiveannotations in.env.schema.CI compatibility
[ -t 0 ]check falls back to plainread -rwhen stdin is piped (CI), so automated tests are unaffected.